package com.gh.pattern.factory.simple;

import com.gh.test.Apple;
import com.gh.test.CellPhone;
import com.gh.test.Huawei;
import com.gh.test.Xiaomi;

public class SimpleFactory {
    public CellPhone getCellPhone(String name) {
        if("小米".equals(name)){
            return new Xiaomi();
        } else if ("华为".equals(name)) {
            return  new Huawei();
        } else if ("苹果".equals(name)) {
            return  new Apple();
        } else {
            System.out.println("不能生产你需要的产品");
            return null;
        }
    }
}
